using System.Web.Mvc;
using ExtendedMvc.Html;

namespace ExtendedMvc.Elements {
	public abstract class Region<T> : VisibleElement<T> where T : Region<T> {

		protected object content { get; private set; }

		protected Region(string id = null)
			: base(HtmlTag.Div, id) {
		}

		protected virtual T Content(object value) {
			this.content = value;
			return (T)this;
		}

		protected override TagRenderMode TagRenderMode { get { return TagRenderMode.Normal; } }

		protected override void SetContent() {
			Builder.InnerHtml = content.ToString();
		}
	}
}
